/*                                  ATELIER                                   */

/* %%LICENSE_TAG%%                                                            */
package edu.gmu.view.cube;

import edu.gmu.atelier.AffineVector;
import edu.gmu.atelier.Matrix;
import edu.gmu.atelier.Vector;
import java.awt.Graphics2D;
import javax.swing.JComponent;

import java.awt.Color;
import java.util.ArrayList;
import java.util.List;

/*******************************************************************
 * Cube represents 8 vertexes making 6 faces.
 * @author  James H. Pope
 * @version $Id:$
 *******************************************************************/
public class Circle //implements Sprite
{
    /**
     * faces
     */
    protected Face a = null; //front-side
    protected Face b = null; //right-side
    protected Face c = null; // back-side
    protected Face d = null; // left-side

    protected Face e = null; //  top-side
    protected Face f = null; //bottom-side
    
    /**
     * Creates a new CubeLayer with specified parameters.
     */
    public Circle ( double s )
    {
        AffineVector p1 = new AffineVector(  -s,  -s,   s );
        AffineVector p2 = new AffineVector(   s,  -s,   s );
        AffineVector p3 = new AffineVector(   s,   s,   s );
        AffineVector p4 = new AffineVector(  -s,   s,   s );

        AffineVector p5 = new AffineVector(  -s,  -s,  -s );
        AffineVector p6 = new AffineVector(   s,  -s,  -s );
        AffineVector p7 = new AffineVector(   s,   s,  -s );
        AffineVector p8 = new AffineVector(  -s,   s,  -s );

        this.a = new Face( p1, p2, p3, p4 );
        this.b = new Face( p2, p6, p7, p3 );
        this.c = new Face( p6, p5, p8, p7 );
        this.d = new Face( p5, p1, p4, p8 );

        this.e = new Face( p3, p7, p8, p4 );
        this.f = new Face( p5, p6, p2, p1 );
    }
    
    
    /*********************************************************************
     * Paints images on specified Component object using passed Graphics.
     * @param component
     * @param graphics
     *********************************************************************/
    public void draw( JComponent  component, Graphics2D  graphics, Pen pen )
    {
//        int width  = component.getWidth();
//        int height = component.getHeight();
//        
//        // Unit circle
//        double radianInterval = Math.PI/64;
//        double vectorDirection= 0.0;
//        List<Vector> unitVectors = new ArrayList<Vector>();
//        while( vectorDirection < 2.0*Math.PI )
//        {
//            double x = Math.cos(vectorDirection);
//            double y = Math.sin(vectorDirection);
//            AffineVector
//            Vector v = a.getFactory().makeVector( new double[]{x,y} );
//            unitVectors.add(v);
//            vectorDirection+=radianInterval;
//        }
//        Matrix u = new Matrix(unitVectors, factory);
//        pen.setColor( Color.RED );
//        drawMatrix(u,pen);
    }
     
}

/*                                  ATELIER                                   */
